﻿@using Zocono.WCS.Admin.Models.User
@model UserModel

<header class="navbar-wrapper">
    <div class="navbar navbar-fixed-top">
        <div class="container-fluid cl">
            <a class="logo navbar-logo f-l mr-10 hidden-xs">瑞浦WCS管理系统</a> <a aria-hidden="false" class="nav-toggle Hui-iconfont visible-xs" href="javascript:;">&#xe667;</a>
            <nav id="Hui-userbar" class="nav navbar-nav navbar-userbar hidden-xs">
                <ul class="cl">
                    <li>@Model.RoleName</li>
                    <li class="dropDown dropDown_hover">
                        <a href="#" class="dropDown_A">@Model.UserName <i class="Hui-iconfont">&#xe6d5;</i></a>
                        <ul class="dropDown-menu menu radius box-shadow">
                            <li><a onclick="userInfo()">用户信息</a></li>
                            <li><a onclick="updatePwd()">修改密码</a></li>
                            <li><a onclick="quitLogin()">退出</a></li>
                        </ul>
                    </li>
 @*                   <li id="Hui-msg"> <a href="#" title="消息"><span class="badge badge-danger">1</span><i class="Hui-iconfont" style="font-size:18px">&#xe68a;</i></a> </li>*@
                    <li id="Hui-skin" class="dropDown right dropDown_hover">
                        <a href="javascript:;" class="dropDown_A" title="换肤"><i class="Hui-iconfont" style="font-size:18px">&#xe62a;</i></a>
                        <ul class="dropDown-menu menu radius box-shadow">
                            <li><a href="javascript:;" data-val="default" title="默认（黑色）">默认（黑色）</a></li>
                            <li><a href="javascript:;" data-val="blue" title="蓝色">蓝色</a></li>
                            <li><a href="javascript:;" data-val="green" title="绿色">绿色</a></li>
                            <li><a href="javascript:;" data-val="red" title="红色">红色</a></li>
                            <li><a href="javascript:;" data-val="yellow" title="黄色">黄色</a></li>
                            <li><a href="javascript:;" data-val="orange" title="橙色">橙色</a></li>
                        </ul>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</header>
<script>
  //-----------------刷卡登入----------------------\\

         function LoginIc(code) {
           $.ajax({
                type: "POST",
                url: "/home/UserLoginByIc",
               data: {
                   "ic":code
               },
                success: function(data) {
                    if (data.result) {
                        window.location = "/Home/Index";
                    }
                    else {
                        alert(data.message);
                    }
                }
            });
        }
        var a = ""
        $("body").keydown(function(e) {

            if (a.indexOf("Enter") == -1 && !isNaN(e.key)) {
                //console.log(e.key)
                a += e.key
            }

            if (e.key == "Enter") {
                if (a.length == 10) {
                    console.log("输入：" + a.replace(/[^0-9]/g, ''))
                   LoginIc(a.replace(/[^0-9]/g, ''))
                }


                a = ""

            }
        })
        //----------------------------------------------\\
</script>